import React from 'react';
import { Text, View } from 'react-native';
import _ from 'lodash';
import styles from './style';

export default ({ data = [] }) => {
  if (_.isEmpty(data)) {
    return null;
  }
  return (
    <View style={styles.tags}>
      {_.map(data, ({ name }, i) => (
        <Text key={`tag_${i}`} style={styles.tag}>
          {name}
        </Text>
      ))}
    </View>
  );
};
